package top.lgd.controller.person;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.lgd.base.LgdResult;
import top.lgd.controller.LgdController;
import top.lgd.pojo.res.person.BalanceLine;
import top.lgd.pojo.res.person.PersonOverviewRes;
import top.lgd.service.person.BalanceService;

import java.util.List;

/**
 * @author YYJ
 * @version 1.0
 * @since 2023/12/19 19:12
 */
@RestController
@RequestMapping("/admin/person")
public class PersonAdminController extends LgdController {


    @Autowired
    private BalanceService balanceService;

    /**
     * 查询 个人账户流水 列表
     *
     * @return
     */
    @PostMapping("queryOverview")
    public LgdResult<PersonOverviewRes> queryOverview() {
        return LgdResult.success(balanceService.queryOverview(current().getId()));
    }

    /**
     * 查询 个人账户流水 列表
     *
     * @return
     */
    @PostMapping("queryBalanceList")
    public LgdResult<List<BalanceLine>> queryBalanceList() {
        return LgdResult.success(balanceService.queryBalanceList(current().getId()));
    }
}